﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Loginter.登录用户信息.Login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>晶科物流管理系统</title>
    <link href="../css/bootstrap.css" rel="stylesheet" />
    <link href="../css/css.css" rel="stylesheet" />
    <script src="../js/jquery1.9.0.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/sdmenu.js"></script>
    <script src="../js/laydate/laydate.js"></script>
    <script src="../Scripts/jquery-1.11.3.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#Button1").click( function () {

                var account = $("#txt_name").val();
                var password = $("#txt_password").val();

                //AJAX的使用
                //$.ajax({
                //    type: "POST",
                //    url: "/ajax/Login.ashx",
                //    data: { Account: account, Password: password },
                //    success: function (msg) {
                //        if (msg == "yes") {
                //            location.href="UserInfoXiangQing.aspx";
                //        }
                //        else {
                //            alert(msg);
                //        }
                //    }
                //});

                //GET的使用
                //$.get("/ajax/Login.ashx", {Account:account,Password:password},
                //       function (data) {
                //           if (data == "yes") {
                //               location.href="UserInfoXiangQing.aspx";
                //           }
                //           else {
                //               alert(data);
                //           }
                //       });

                //POST的使用
                //$.post("/ajax/Login.ashx", { Account: account, Password: password },
                //       function (data) {
                //          if (data == "ok") {
                //             location.href="UserInfoXiangQing.aspx";
                //              }
                //             else {
                //                   alert(data);
                //                    }
                //                  });

                //JSON的使用
                $.post("/ajax/Login.ashx", { Account: account, Password: password }, function (data) {
                    if (data.State == 1) {
                        location.href = "UserInfoXiangQing.aspx";
                    }
                    else {
                        alert(data.Message);
                    }

                }, "json");

            });
        });
    </script>

    <style type="text/css">
        body {
            background: #0066A8 no-repeat center 0px;
        }

        .tit {
            margin: auto;
            margin-top: 170px;
            text-align: center;
            width: 350px;
            padding-bottom: 20px;
        }

        .login-wrap {
            width: 220px;
            padding: 30px 50px 0 330px;
            height: 220px;
            background: #fff url(../img/20150212154319.jpg) no-repeat 30px 40px;
            margin: auto;
            overflow: hidden;
        }

        .login_input {
            display: block;
            width: 210px;
        }

        .login_user {
            background: url(../img/input_icon_1.png) no-repeat 200px center;
            font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
        }

        .login_password {
            background: url(../img/input_icon_2.png) no-repeat 200px center;
            font-family: "Courier New", Courier, monospace;
        }

        .btn-login {
            background: #40454B;
            box-shadow: none;
            text-shadow: none;
            color: #fff;
            border: none;
            height: 35px;
            line-height: 26px;
            font-size: 14px;
            font-family: "microsoft yahei";
        }

            .btn-login:hover {
                background: #333;
                color: #fff;
            }

        .copyright {
            margin: auto;
            margin-top: 10px;
            text-align: center;
            width: 370px;
            color: #CCC;
        }

        @media (max-height: 700px) {
            .tit {
                margin: auto;
                margin-top: 100px;
            }
        }

        @media (max-height: 500px) {
            .tit {
                margin: auto;
                margin-top: 50px;
            }
        }
    </style>
</head>

<body>
    <form id="form1" runat="server">
        <div class="tit">
            <img src="../img/tit.png" alt="" />
        </div>
        <div class="login-wrap">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td height="25" valign="bottom">用户名：</td>
                </tr>
                <tr>
                    <td>
                        <asp:TextBox ID="txt_name" class="login_input login_user" runat="server"></asp:TextBox>

                    </td>
                </tr>
                <tr>
                    <td height="35" valign="bottom">密  码：</td>
                </tr>
                <tr>
                    <td>
                        <asp:TextBox ID="txt_password" class="login_input login_password" runat="server" TextMode="Password"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td height="60" valign="bottom">
                        <asp:Button ID="Button1" class="btn btn-block btn-login" runat="server" Text="AJAX登录"  OnClick="btn_login_Click" />
                        <asp:Button ID="btn_login" class="btn btn-block btn-login" runat="server" Text="登录" OnClick="btn_login_Click" />
                        <asp:Label ID="labInfo" runat="server" Text="Label" Visible="false"></asp:Label>
                    </td>
                </tr>

            </table>
        </div>
        <div class="copyright">建议使用IE8以上版本或谷歌浏览器</div>
    </form>
</body>
</html>
